<script>
import {
  createRouter,
  createWebHashHistory,
} from 'vue-router'

import Input from "@/components/input/Input";
import Sell from "@/components/sell/Sell"
import App from "@/App";
import Scan from "@/components/Scan";
import login from "@/components/login/login";

const routes = [
// 路由的默认路径
  {
    path: '/',
    redirect: '/sms/sell'
  },
  {
    path: '/sms',
    component:()=>import("../components/Sms"),
    meta: {
      needLogin: true //需要加校检判断的路由
    },
    children:[
      {
        path: '/sms/scan',
        name: "scan1",
        component: ()=>import("../components/Scan")
      },
      {
        path: '/sms/input',
        component: ()=>import("../components/input/Input")
      },
      {
        path: '/sms/sell',
        name:"sell",
        component: ()=>import("../components/sell/Sell"),
        children:[{
          path: '/sms/sell/scan',
          name:'scan2',
          component: ()=>import("../components/Scan")
        },
          {
            path: '/sms/sell/displaybycode',
            component: ()=>import("../components/sell/GoodsDisplayByCode")
          },
          // {
          //   path: '/sms/sell/display',
          //   component: ()=>import("../components/sell/SellDisplay")
          // },

        ]
      },

      {
        path: '/sms/rounte',
        component:()=>import("../components/rounte")
      },

      {
        path: '/sms/goodsinfo',
        component: ()=>import("../components/goods/GoodsInfo")
      },
      {
        path: '/sms/goodsdisplay',
        component: ()=>import("../components/goods/GoodsDisplay")
      },
      {
        path: '/sms/updateggods',
        component:()=>import("../components/goods/UpdateGoods")
      },
    ]
  },
  {
    path: '/sign',
    component:()=>import("../components/login/Sign")
  },
  {
    path: '/login',
    name:login,
    component:()=>import("../components/login/login")
  }

]

// 创建路由对象
const router = createRouter({
  history: createWebHashHistory(),
  routes
})
export default router;
</script>